﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace CI.Caja.DL
{
    public class DA_SingletonConexion
    {

        private static volatile SqlConnection instance;
        private static object syncObj = new Object();

        private DA_SingletonConexion() { }

        public static SqlConnection ConnectionInstance
        {
            get
            {
                if (instance == null)
                {
                    lock (syncObj)
                    {
                        if (instance == null)
                            //instance = new SqlConnection(DA_Utilitario.ObtenerConexion());
                            instance = new SqlConnection();
                    }
                }
                instance.ConnectionString = DA_Utilitario.ObtenerConexion();
                return instance;
            }
        }
    }
}
